package com.yanqu.road.entity.monopolymarket.group;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * 跨服收到跨服分组变化会同步该表
 * @Description 当前区服的榷场分组信息
 * @Author cwq
 * @Data 2021/8/11 18:06
 */
@FieldTypeAnnotation(tableName = "t_s_monopolymarket_server_group")
public class MonopolyMarketServerGroup extends DataObject implements IMonopolyMarketGroup {
    @FieldTypeAnnotation(select = true, update = true)
    private long serverId;
    @FieldTypeAnnotation(desc = "channelId")
    private int channelId;
    @FieldTypeAnnotation(desc = "分组id、区服id")
    private long groupId;
    @FieldTypeAnnotation(desc = "区服")
    private List<Long> serverList = new ArrayList<>();
    @FieldTypeAnnotation(desc = "状态 0关闭 1打开")
    private int state;
    @FieldTypeAnnotation(desc = "边关要塞是否开启 (0关闭 1开启)")
    private int fortressState;
    @FieldTypeAnnotation(desc = "最后一次修改分组区服的时间")
    private int changTime;
    @FieldTypeAnnotation(desc = "最后一次修改榷署配置的时间")
    private int officeCfgChangTime;
    @FieldTypeAnnotation(desc = "最后一次修改王帐配置的时间")
    private int kingCfgChangTime;
    @FieldTypeAnnotation(desc = "最后一次修改王宫配置的时间")
    private int queenCfgChangTime;
    @FieldTypeAnnotation(desc = "上一次锁定参与联盟资格的时间")
    private int fortressLockJoinUnionLastTime;
    @FieldTypeAnnotation(desc = "上一次锁定参与联盟玩家资格的时间")
    private int fortressLockJoinUnionMemberLastTime;
    @FieldTypeAnnotation(desc = "可以参赛的联盟id")
    private List<String> fortressCanJoinUnionIdList = new CopyOnWriteArrayList<>();

    public long getServerId() {
        return serverId;
    }
    public void setServerId(long serverId) {
        if (this.serverId != serverId) {
            this.serverId = serverId;
            setOp(DataStatus.Update);
        }
    }

    public int getChannelId() {
        return channelId;
    }
    public void setChannelId(int channelId) {
        if (this.channelId != channelId) {
            this.channelId = channelId;
            setOp(DataStatus.Update);
        }
    }

    public long getGroupId() {
        return groupId;
    }
    public void setGroupId(long groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public java.util.List<java.lang.Long> getServerList() {
        return serverList;
    }
    public void setServerList(java.util.List<java.lang.Long> serverList) {
        if (null == serverList){
            return;
        }
        if (this.serverList == null || !this.serverList.equals(serverList)) {
            this.serverList = serverList;
            setOp(DataStatus.Update);
        }
    }

    public int getState() {
        return state;
    }
    public void setState(int state) {
        if (this.state != state) {
            this.state = state;
            setOp(DataStatus.Update);
        }
    }

    public int getFortressState() {
        return fortressState;
    }

    public void setFortressState(int fortressState) {
        if (this.fortressState != fortressState) {
            this.fortressState = fortressState;
            setOp(DataStatus.Update);
        }
    }

    public int getChangTime() {
        return changTime;
    }
    public void setChangTime(int changTime) {
        if (this.changTime != changTime) {
            this.changTime = changTime;
            setOp(DataStatus.Update);
        }
    }

    public int getOfficeCfgChangTime() {
        return officeCfgChangTime;
    }
    public void setOfficeCfgChangTime(int officeCfgChangTime) {
        if (this.officeCfgChangTime != officeCfgChangTime) {
            this.officeCfgChangTime = officeCfgChangTime;
            setOp(DataStatus.Update);
        }
    }

    public int getKingCfgChangTime() {
        return kingCfgChangTime;
    }
    public void setKingCfgChangTime(int kingCfgChangTime) {
        if (this.kingCfgChangTime != kingCfgChangTime) {
            this.kingCfgChangTime = kingCfgChangTime;
            setOp(DataStatus.Update);
        }
    }

    public int getQueenCfgChangTime() {
        return queenCfgChangTime;
    }
    public void setQueenCfgChangTime(int queenCfgChangTime) {
        if (this.queenCfgChangTime != queenCfgChangTime) {
            this.queenCfgChangTime = queenCfgChangTime;
            setOp(DataStatus.Update);
        }
    }

    @Override
    public long getMonopolyMarketGroupId() {
        return this.groupId;
    }

    @Override
    public List<Long> getMonopolyMarketServerList() {
        return this.getServerList();
    }

    @Override
    public int getMonopolyMarketChangeTime() {
        return this.getChangTime();
    }

    @Override
    public int getMonopolyMarketFortressState() {
        return this.getFortressState();
    }

    public int getFortressLockJoinUnionLastTime() {
        return fortressLockJoinUnionLastTime;
    }

    public void setFortressLockJoinUnionLastTime(int fortressLockJoinUnionLastTime) {
        if (this.fortressLockJoinUnionLastTime != fortressLockJoinUnionLastTime) {
            this.fortressLockJoinUnionLastTime = fortressLockJoinUnionLastTime;
            setOp(DataStatus.Update);
        }
    }

    public int getFortressLockJoinUnionMemberLastTime() {
        return fortressLockJoinUnionMemberLastTime;
    }

    public void setFortressLockJoinUnionMemberLastTime(int fortressLockJoinUnionMemberLastTime) {
        if (this.fortressLockJoinUnionMemberLastTime != fortressLockJoinUnionMemberLastTime) {
            this.fortressLockJoinUnionMemberLastTime = fortressLockJoinUnionMemberLastTime;
            setOp(DataStatus.Update);
        }
    }

    public List<String> getFortressCanJoinUnionIdList() {
        return fortressCanJoinUnionIdList;
    }

    public void setFortressCanJoinUnionIdList(List<String> fortressCanJoinUnionIdList) {
        if (null == fortressCanJoinUnionIdList){
            return;
        }
        if (this.fortressCanJoinUnionIdList == null || !this.fortressCanJoinUnionIdList.equals(fortressCanJoinUnionIdList)) {
            this.fortressCanJoinUnionIdList = fortressCanJoinUnionIdList;
            setOp(DataStatus.Update);
        }
    }

}
